home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Utilities / AmigaWriter-Filter / Install < prev    next >
Text File  |  2000-12-28  |  4KB  |  121 lines

  1. ; Installation script for AmigaWriter-Filter
  2. ;
  3. ; ©2000 by Rüdiger Hanke
  4.  
  5. (set #FILTERPATH "SoftLogik:Filters")
  6. (set #INSTALLPATH "install_data")
  7. (set #DOCFILTER (cat #FILTERPATH "/AmigaWriter.dfilter"))
  8. (set #TEXTFILTER (cat #FILTERPATH "/AmigaWriter.tfilter"))
  9. (set #INST_DOCFILTER (cat #INSTALLPATH "/AmigaWriter.dfilter"))
  10. (set #INST_TEXTFILTER (cat #INSTALLPATH "/AmigaWriter.tfilter"))
  11.  
  12. (set #INSTALL_TFILTER 1)
  13. (set #INSTALL_DFILTER 1)
  14.  
  15. (set @app-name "AmigaWriter-Filter")
  16. (set @default-dest (cat "" #FILTERSPATH))
  17.  
  18. ; First check some stuff
  19. (if (patmatch "68000|68010" (database "cpu"))
  20.    (
  21.         (abort "Sorry, but you need an 68020+ processor.")
  22.    )
  23. )
  24.  
  25. (if (<> 2 (exists #FILTERPATH (noreq)))
  26.    (
  27.       (abort "Your PageStream installation is incomplete!\n\nThis is a filter for Soft-Logik's DTP program PageStream.\n"
  28.              "PageStream must be installed correctly on your computer.\n\nPlease install PageStream properly, then run the install script again.")
  29.    )
  30. )
  31.  
  32. (if (or (<> 1 (exists #INST_DOCFILTER (noreq)))
  33.         (<> 1 (exists #INST_TEXTFILTER (noreq))))
  34.    (
  35.       (abort "Incomplete installation package!\n\nThe installer could not find some required files.\n"
  36.              "Be sure to download the original AmigaWriter-Filter distribution\nfrom Aminet or http://www.muenster.de/~tomjoad/.")
  37.    )
  38. )
  39.  
  40. ; Ask what to install if user != novice
  41. (if (<> @user-level 0)
  42.    (
  43.       (set #RESULT   (askoptions (prompt "Please select which filter(s) you'd like to install:")
  44.                      (choices "Document filter" "Text filter")
  45.                      (help "Select the filters you would like to install.\n\nDocument filter:\n"
  46.                            "With the document filter, you can load AmigaWriter documents in PageStream "
  47.                            "via the \"Open\" menu item as if they were PageStream-native documents. Page sizes, boxes, images, "
  48.                            "links between boxes etc. will all be imported.\n\n"
  49.                            "Text filter:\nThe text filters imports the main flowtext of your AmigaWriter "
  50.                            "document via the \"Insert text\" menu item into the current column.\n\n"
  51.                            "Both filters can co-exist and unless you absolutely don't need one of them, "
  52.                            "there is no reason to install only one.")))
  53.  
  54.       (if (not (bitand 1 #RESULT))
  55.          (
  56.             (set #INSTALL_DFILTER   0)
  57.          )
  58.       )
  59.  
  60.       (if (not (bitand 2 #RESULT))
  61.          (
  62.             (set #INSTALL_TFILTER   0)
  63.          )
  64.       )
  65.    )
  66. )
  67.  
  68. ; Install
  69. (if (<> 0 #INSTALL_DFILTER)
  70.    (
  71.         ; Check version number
  72.         (set #VER_FILTER (getversion #DOCFILTER))
  73.         (set #VER_VER (/ #VER_FILTER 65536))
  74.         (set #VER_REV (- #VER_FILTER (* #VER_VER 65536)))
  75.  
  76.         (set #VER_NEWFILTER (getversion #INST_DOCFILTER))
  77.         (set #VER_NEWVER (/ #VER_NEWFILTER 65536))
  78.         (set #VER_NEWREV (- #VER_NEWFILTER (* #VER_NEWVER 65536)))
  79.  
  80.         (if (or (> #VER_VER #VER_NEWVER) (and (= #VER_VER #VER_NEWVER) (>= #VER_REV #VER_NEWREV)))
  81.             (
  82.                 (message "The document filter installed on your system is a later "
  83.                             "version than the one to install.\n\nThe document filter will not be installed.")
  84.             )
  85.             (
  86.                 ; Copy document filter to filter path
  87.                 (copyfiles  (source  #INST_DOCFILTER)
  88.                                 (dest    #FILTERPATH)
  89.                                 (prompt  "Installing document filter..."))
  90.             )
  91.         )
  92.    )
  93. )
  94.  
  95. (if (<> 0 #INSTALL_TFILTER)
  96.    (
  97.         ; Check version number
  98.         (set #VER_FILTER (getversion #TEXTFILTER))
  99.         (set #VER_VER (/ #VER_FILTER 65536))
  100.         (set #VER_REV (- #VER_FILTER (* #VER_VER 65536)))
  101.  
  102.         (set #VER_NEWFILTER (getversion #INST_TEXTFILTER))
  103.         (set #VER_NEWVER (/ #VER_NEWFILTER 65536))
  104.         (set #VER_NEWREV (- #VER_NEWFILTER (* #VER_NEWVER 65536)))
  105.  
  106.         (if (or (> #VER_VER #VER_NEWVER) (and (= #VER_VER #VER_NEWVER) (>= #VER_REV #VER_NEWREV)))
  107.             (
  108.                 (message "The text filter installed on your system is a later "
  109.                             "version than the one to install.\n\nThe text filter will not be installed.")
  110.             )
  111.             (
  112.                 ; Copy text filter to filter path
  113.                 (copyfiles  (source  #INST_TEXTFILTER)
  114.                                 (dest    #FILTERPATH)
  115.                                 (prompt  "Installing text filter..."))
  116.             )
  117.         )
  118.    )
  119. )
  120.  
  121.